home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / STREAMER / OEMSETUP.INF < prev    next >
Encoding:
INI File  |  1996-07-31  |  38.4 KB  |  1,226 lines

  1. ;-------------------------------------------------------------------
  2. ;
  3. ;   MODULE NAME:   OEMSETUP.INF
  4. ;
  5. ;   DESCRIPTION:   Installation parameter script for busmaster
  6. ;                  network adapter drivers running under
  7. ;                  Microsoft Windows NT.
  8. ;
  9. ;                  This script is interpreted by SETUP.EXE
  10. ;                  during driver installation.  It consists
  11. ;                  of the following four required sections
  12. ;                  and other supporting sections:
  13. ;
  14. ;                  1.  Identify
  15. ;                  2.  ReturnOptions
  16. ;                  3.  InstallOption
  17. ;                  4.  Source Media Descriptions
  18. ;-------------------------------------------------------------------
  19.  
  20. ;-------------------------------------------------------------------
  21. ;   SECTION NAME:       Identify
  22. ;
  23. ;   DESCRIPTION:        This required section verifies that this
  24. ;                       script supports the option currently selected.
  25. ;
  26. ;   INPUT:              None.
  27. ;
  28. ;   OUTPUT:             $($R0)      Status
  29. ;                       $($R1)      Option Type
  30. ;                       $($R2)      Diskette Description
  31. ;-------------------------------------------------------------------
  32.  
  33. [Identify]
  34.  
  35.     set Status      =   STATUS_SUCCESSFUL
  36.     set OptionType  =   NetAdapter
  37.     set Media       =   #("Source Media Descriptions", 1, 1)
  38.     return $(Status) $(OptionType) $(Media)
  39.  
  40. [Source Media Descriptions]
  41.  
  42.     1  = "IBM Streamer Installation Disk"
  43. ;    2  = "Windows NT Setup CD-ROM Disk"
  44.  
  45. [Signature]
  46.     FileType = MICROSOFT_DRVLIB_FILE
  47. [GetSignature]
  48.     read-syms Signature
  49.     return $(FileType)
  50.  
  51. ;-------------------------------------------------------------------
  52. ;   SECTION NAME:       ReturnOptions
  53. ;
  54. ;   DESCRIPTION:        This required section returns the list of
  55. ;                       options supported by this script and the
  56. ;                       text list representing the options.
  57. ;
  58. ;
  59. ;   INPUT:              $($0)       Language code
  60. ;
  61. ;   OUTPUT:             $($R0)      Status
  62. ;                       $($R1)      Option List
  63. ;                       $($R2)      Option Text List
  64. ;-------------------------------------------------------------------
  65.  
  66. [ReturnOptions]
  67.  
  68.     set Status          =   STATUS_FAILED
  69.     set OptionList      =   {}
  70.     set OptionTextList  =   {}
  71.     set LanguageList    =   ^(LanguagesSupported, 1)
  72.  
  73.     ifcontains(i) $($0) not-in $(LanguageList)
  74.         set Status = STATUS_NOLANGUAGE
  75.         goto End_ReturnOptions
  76.     endif
  77.  
  78.     ifstr(i) $($1) == ""
  79.         goto OK_ReturnOptions
  80.     endif
  81.  
  82.     set PlatformList = ^(PlatformsSupported, 1)
  83.     Ifcontains(i) $($1) in $(PlatformList)
  84.         goto OK_ReturnOptions
  85.     else
  86.         set Status = STATUS_NOTSUPPORTED
  87.         goto End_ReturnOptions
  88.     endif
  89.  
  90. OK_ReturnOptions = +
  91.     set OptionList      = ^(Options, 1)
  92.     set OptionTextList  = ^(OptionsText$($0), 1)
  93.     set Status          = STATUS_SUCCESSFUL
  94.  
  95. End_ReturnOptions = +
  96.     Return $(Status) $(OptionList) $(OptionTextList)
  97.  
  98. [LanguagesSupported]
  99.  
  100.     ENG
  101.  
  102. [PlatformsSupported]
  103.  
  104.     MCA
  105.     ISA
  106.     EISA
  107.     PCI
  108. [Options]
  109.  
  110.     STREAMER
  111.  
  112. [OptionsTextENG]
  113.  
  114.     STREAMER    =   "IBM Streamer Family Adapters"
  115.  
  116.  
  117. ;-------------------------------------------------------------------
  118. ;
  119. ;   SECTION NAME:       InstallOption
  120. ;
  121. ;   DESCRIPTION:        This required section is shelled to by main
  122. ;                       installation processing or by NCPASHEL.INF
  123. ;                       during reconfiguration, removal, update,
  124. ;                       etc.  It performs three main functions:
  125. ;
  126. ;                       1.  Copies files representing options
  127. ;                       2.  Configures the installed option
  128. ;                       3.  Updates the registry for the installed
  129. ;                           option.
  130. ;
  131. ; INPUT:                $($0)       Language to use
  132. ;                       $($1)       OptionID to install
  133. ;                       $($2)       SourceDirectory
  134. ;                       $($3)       AddCopy  (YES | NO)
  135. ;                       $($4)       DoCopy   (YES | NO)
  136. ;                       $($5)       DoConfig (YES | NO)
  137. ;
  138. ; OUTPUT:               $($R0)      Status
  139. ;
  140. ;------------------------------------------------------------------------
  141.  
  142. [InstallOption]
  143.  
  144.     StartWait
  145.  
  146.     set Status  =   STATUS_FAILED
  147.  
  148.     set Option   = $($1)
  149.     set SrcDir   = $($2)
  150.     set AddCopy  = $($3)
  151.     set DoCopy   = $($4)
  152.     set DoConfig = $($5)
  153.  
  154.     set LanguageList = ^(LanguagesSupported, 1)
  155.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  156.         Return STATUS_NOLANGUAGE
  157.     endif
  158.  
  159.     read-syms GeneralConstants
  160.     read-syms FileConstants
  161.     read-syms FileConstants$(!STF_LANGUAGE)
  162.  
  163.     detect date
  164.  
  165.     set-title  $(FunctionTitle)
  166.  
  167.     set to   = Begin
  168.     set from = Begin
  169.  
  170.     set CommonStatus = STATUS_SUCCESSFUL
  171.  
  172.     EndWait
  173.  
  174. Begin = +
  175.  
  176.     ifstr(i) $(!NTN_InstallMode) == DeInstall
  177.         set from = fatal
  178.         set to   = fatal
  179.         goto RemoveAdapter
  180.     endif
  181.  
  182.     ifstr(i) $(!NTN_InstallMode) == Update
  183.         set from = fatal
  184.         set to   = fatal
  185.         goto UpgradeSoftware
  186.     endif
  187.  
  188.     ifstr(i) $(!NTN_InstallMode) == Bind
  189.         set from = fatal
  190.         set to   = fatal
  191.         goto BindingAdapter
  192.     endif
  193.  
  194.     ifstr(i) $(!NTN_InstallMode) == Configure
  195.         set CommonStatus = STATUS_REBOOT
  196.         ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  197.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  198.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  199.                 goto ShellCodeError
  200.             endif
  201.             set Error = $($R0)
  202.             set from  = end
  203.             set to    = end
  204.             goto NonFatalInfo
  205.         endif
  206.         set from = fatal
  207.         set to   = fatal
  208.         goto ConfigureAdapter
  209.     endif
  210.  
  211.     set OEM_ABANDON_OPTIONS = {}
  212.     set OEM_ABANDON_SOFTWARE = FALSE
  213.     set OEM_ABANDON_ON = TRUE
  214.     set from = fatal
  215.     set to = fatal
  216.     goto InstallAdapter
  217.  
  218. InstallAdapter = +
  219.  
  220.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  221.  
  222.     Ifstr $(KeyProduct) == $(KeyNull)
  223.         set OldVersionExisted = $(FALSE)
  224.         goto LoadDLL
  225.     endif
  226.  
  227. OldInstall = +
  228.  
  229.     CloseRegKey $(KeyProduct)
  230.  
  231.     ifstr(i) $(!NTN_RegBase) == $(ProductKeyName)
  232.  
  233.         Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  234.             $(ProductVersion)
  235.  
  236.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  237.             goto ShellCodeError
  238.         endif
  239.  
  240.         goto end
  241.  
  242.     endif
  243.  
  244.     Shell $(UtilityInf), CardExistedDlg
  245.  
  246.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  247.         goto ShellCodeError
  248.     endif
  249.  
  250.     ifstr(i) $($R1) != "OK"
  251.         Set CommonStatus = STATUS_USERCANCEL
  252.         goto end
  253.     endif
  254.  
  255.     set OldVersionExisted = $(TRUE)
  256.  
  257. LoadDLL = +
  258.  
  259.     set OldSource = $(!STF_SRCDIR)
  260.  
  261.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(!STF_SRCDIR)
  262.  
  263.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  264.         goto fatal
  265.     endif
  266.     Ifstr(i) $($R0) == STATUS_FAILED
  267.         goto fatal
  268.     endif
  269.     Ifstr(i) $($R0) == STATUS_USERCANCEL
  270.         goto end
  271.     endif
  272.  
  273.     set !STF_SRCDIR = $($R1)
  274.  
  275.     install "Install-Dll"
  276.  
  277.     set !STF_SRCDIR = $(OldSource)
  278.  
  279.     StartWait
  280.  
  281.     ;
  282.     ;   PH 03/14/95 - Added 170 and 171 for dual adapters
  283.     ;
  284.     Set STREAMER_2BYTE = 143
  285.     Set STREAMER_1BYTE_LIST = {160, 162, 164, 168, 170, 171}
  286.     Set AdapterList = {}
  287.  
  288.     ForListDo $(STREAMER_1BYTE_LIST)
  289.  
  290.         Set STREAMER_1BYTE = $($)
  291.  
  292.         set-mul mcaid = $(STREAMER_2BYTE), 256
  293.         set-add mcaid = $(mcaid), $(STREAMER_1BYTE)
  294.         set-dectohex mcaid_hex = $(mcaid)
  295.  
  296.         Shell $(UtilityInf), MCAFindBus, $(STREAMER_1BYTE), $(STREAMER_2BYTE)
  297.  
  298.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  299.             goto ShellCodeError
  300.         endif
  301.  
  302.         ifstr $($R0) != "NO_ERROR"
  303.             set Error = $($R0)
  304.             goto fatal
  305.         endif
  306.  
  307.         ifstr(i) $($R1) != {}
  308.  
  309.             set MCA_List = $($R1)
  310.  
  311.             ForListDo $(MCA_List)
  312.  
  313.                 Set BusSlotMca = $($)
  314.  
  315.                                 Set BusNum              =       *($(BusSlotMca),1)
  316.                                 Set SlotNum             =       *($(BusSlotMca),2)
  317.                                 Set NetcardId           =       *($(BusSlotMca),3)
  318.                                 Set DualPort            =       "0"
  319.                                 Set BusSlotMca          =       {$(BusNum),$(SlotNum),$(NetcardId),+
  320.                                                                                 $(DualPort)}
  321.                                 Set AdapterList         =       >($(AdapterList),$(BusSlotMca))
  322.                 ;
  323.                                 ;       If this is a dual adapter, make a second
  324.                                 ;       list entry for the "B" side
  325.                 ;
  326.                 ifint $(STREAMER_1BYTE) == 170
  327.                                         Set DualPort = "1"
  328.                                         Set BusSlotMca  =       {$(BusNum),$(SlotNum),$(NetcardId),+
  329.                                                                                         $(DualPort)}
  330.                                         Set AdapterList =       >($(AdapterList),$(BusSlotMca))
  331.                 endif
  332.                 ifint $(STREAMER_1BYTE) == 171
  333.                                         Set DualPort = "1"
  334.                                         Set BusSlotMca  =       {$(BusNum),$(SlotNum),$(NetcardId),+
  335.                                                                                         $(DualPort)}
  336.                                         Set AdapterList =       >($(AdapterList),$(BusSlotMca))
  337.                 endif
  338.                 ;
  339.             EndForListDo
  340.  
  341.         endif
  342.  
  343.     EndForListDo
  344.  
  345.     ;   ------------------------------------------------------------
  346.     ;   Prompt for PCI card installation
  347.     ;   ------------------------------------------------------------
  348.  
  349.         Set PromptForPci = "NO"
  350.         ifstr(i) $(!STF_BUSTYPE) == "PCI"
  351.                 Set PromptForPci = "YES"
  352.         else
  353.                 ForListDo $(!STF_BUSTYPELIST)
  354.                         ifstr(i) $($) == "PCI"
  355.                                 Set PromptForPci = "YES"
  356.                         endif
  357.                 EndForListDo
  358.         endif
  359.  
  360.              set Vendor_ID = 4116
  361.              set Device_ID = $(PCI_ADAPTER_ID)
  362.  
  363.                Shell "", GetPCIInformation, $(Vendor_ID), $(Device_ID)
  364.  
  365.                ifint $($ShellCode) != $(!SHELL_CODE_OK)
  366.                    goto ShellCodeError
  367.                endif
  368.  
  369.               ifstr(i) $($R0) != {}
  370.  
  371.                  set PCI_List = $($R0)
  372.  
  373.                  ForListDo $(PCI_List)
  374.  
  375.                           Set BusSlotPCI = $($)
  376.  
  377.                           Set BusNum              =       *($(BusSlotPCI),1)
  378.                           Set SlotNum             =       *($(BusSlotPCI),2)
  379.                           Set NetcardId           =       $(PCI_ADAPTER_ID)
  380.                           Set DualPort            =       "0"
  381.                           Set BusSlotPCI          =       {$(BusNum),$(SlotNum),$(NetcardId),+
  382.                                                                           $(DualPort)}
  383.                           Set AdapterList         =       >($(AdapterList),$(BusSlotPCI))
  384.                  EndForListDo   ; End of PCI_List
  385.  
  386.               endif
  387.     ;   ------------------------------------------------------------
  388.     ;   End of PCI logic
  389.     ;   ------------------------------------------------------------
  390.  
  391.     ifstr(i) $(AdapterList) == {}
  392.         set Error = $(CANNOT_FIND_ANY_CARD)
  393.         set CommonStatus = STATUS_USERCANCEL
  394.         set from = "end"
  395.         goto nonfatal
  396.     endif
  397.  
  398.     ifint $(OldVersionExisted) == $(FALSE)
  399.         goto NewDriverInstall
  400.     else
  401.         goto AfterNewDriverInstall
  402.     endif
  403.  
  404. NewDriverInstall = +
  405.  
  406.     Ifstr(i) $(DoCopy) == "YES"
  407.        Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  408.        Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  409.            Goto ShellCodeError
  410.        Else-Ifstr(i) $($R0) == STATUS_FAILED
  411.            Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  412.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  413.                goto ShellCodeError
  414.            endif
  415.            set Error = $($R0)
  416.            Goto fatal
  417.        Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  418.            Goto successful
  419.        Endif
  420.        Set SrcDir = $($R1)
  421.     Endif
  422.  
  423.     install "Install-Option"
  424.  
  425.     ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  426.        Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  427.        ifint $($ShellCode) != $(!SHELL_CODE_OK)
  428.            goto ShellCodeError
  429.        endif
  430.        set Error = $($R0)
  431.        goto fatal
  432.     endif
  433.  
  434.     Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  435.         $(ProductSoftwareName), +
  436.         $(ProductSoftwareName), +
  437.         $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  438.         $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  439.         $(NetEventDLL)
  440.  
  441.     Set OEM_ABANDON_SOFTWARE = TRUE
  442.  
  443.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  444.         goto ShellCodeError
  445.     endif
  446.  
  447.     set RegistryErrorIndex = $($R0)
  448.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  449.         EndWait
  450.         CloseRegKey $($R1)
  451.         CloseRegKey $($R2)
  452.         CloseRegKey $($R3)
  453.         CloseRegKey $($R4)
  454.         CloseRegKey $($R5)
  455.         goto FatalRegistry
  456.     endif
  457.  
  458.     Set SoftProductKey      = $($R1)
  459.     Set SoftNetRuleKey      = $($R2)
  460.     Set SoftServiceKey      = $($R3)
  461.     Set SoftParameterKey    = $($R4)
  462.     Set SoftLinkageKey      = $($R5)
  463.  
  464.     set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  465.                        {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  466.                        {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  467.                        {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  468.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  469.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  470.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  471.  
  472.     Shell  $(UtilityInf), AddValueList, $(SoftProductKey), $(NewValueList)
  473.  
  474.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  475.         goto ShellCodeError
  476.     endif
  477.  
  478.     set RegistryErrorIndex = $($R0)
  479.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  480.         EndWait
  481.         CloseRegKey $(SoftProductKey)
  482.         CloseRegKey $(SoftNetRuleKey)
  483.         CloseRegKey $(SoftServiceKey)
  484.         CloseRegKey $(SoftParameterKey)
  485.         CloseRegKey $(SoftLinkageKey)
  486.         goto FatalRegistry
  487.     endif
  488.  
  489.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  490.                         {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  491.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  492.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  493.                         {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  494.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  495.  
  496.     Shell  $(UtilityInf), AddValueList, $(SoftNetRuleKey), $(NewValueList)
  497.  
  498.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  499.         goto ShellCodeError
  500.     endif
  501.  
  502.     set RegistryErrorIndex = $($R0)
  503.     CloseRegKey $(SoftProductKey)
  504.     CloseRegKey $(SoftNetRuleKey)
  505.     CloseRegKey $(SoftServiceKey)
  506.     CloseRegKey $(SoftParameterKey)
  507.     CloseRegKey $(SoftLinkageKey)
  508.     Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  509.         EndWait
  510.         goto FatalRegistry
  511.     endif
  512.  
  513. AfterNewDriverInstall = +
  514.  
  515.     ForListDo $(AdapterList)
  516.  
  517.  
  518.  
  519.         Set BusSlotMca = $($)
  520.  
  521.         Set BusNum = *($(BusSlotMca),1)
  522.         Set SlotNum = *($(BusSlotMca),2)
  523.         Set NETCARD_ID = *($(BusSlotMca),3)
  524.         Set DualPort = *($(BusSlotMca),4)
  525.         ;       -------------------------------------------------
  526.         ;       If netcard is already installed, skip this entry
  527.         ;       -------------------------------------------------
  528.  
  529.         Set AlreadyInstalled = "NO"
  530.  
  531.         ;       Make a list of all the installed netcards
  532.  
  533.         OpenRegKey +
  534.                         $(!REG_H_LOCAL),+
  535.                         "",+
  536.                         $(NetworkCardKeyName),+
  537.                         $(MAXIMUM_ALLOWED),+
  538.                         IE_KeyNetcards
  539.         Ifstr $(IE_KeyNetcards) == $(KeyNull)
  540.                 set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  541.                 goto FatalRegistry
  542.         endif
  543.         EnumRegKey $(IE_KeyNetcards) IE_KeyNameList
  544.  
  545.         ;       Compare all the NetworkCards entries to see whether
  546.         ;       they match the current bus number, slot number, title,
  547.         ;       and product name.
  548.  
  549.       ForListDo  $(IE_KeyNameList)
  550.         set IE_KeyName = *($($),1)
  551.         OpenRegKey +
  552.                 $(IE_KeyNetcards),+
  553.                 "",+
  554.                 $(IE_KeyName),+
  555.                 $(MAXIMUM_ALLOWED),+
  556.                 IE_Card
  557.         Ifstr $(IE_Card) == $(KeyNull)
  558.            set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  559.            goto FatalRegistry
  560.         endif
  561.  
  562.         GetRegValue $(IE_Card),"Description", DescriptionInfo
  563.         GetRegValue $(IE_Card),"ProductName", ProductNameInfo
  564.         set CardDescription     = *($(DescriptionInfo), 4)
  565.         set CardProductName     = *($(ProductNameInfo), 4)
  566.  
  567.         ifstr(i) $(CardDescription) == $(ProductHardwareDescription)
  568.           ifstr(i) $(CardProductName) == $(ProductHardwareName)
  569.  
  570.                   ;       The product type matches.  Now check for a
  571.                   ;       match on bus number, slot number, and dual
  572.                   ;       port.
  573.  
  574.                   GetRegValue $(IE_Card), "ServiceName", ServiceNameInfo
  575.                   Set ServiceName = *($(ServiceNameInfo), 4)
  576.  
  577.                   OpenRegKey +
  578.                           $(!REG_H_LOCAL),+
  579.                           "",+
  580.                           "SYSTEM\CurrentControlSet\Services\"$(ServiceName)"\Parameters",+
  581.                           $(MAXIMUM_ALLOWED),+
  582.                           IE_KeyService
  583.  
  584.                   Ifstr $(IE_KeyService) == $(KeyNull)
  585.                      set RegistryErrorIndex = UNABLE_OPEN_NETWORKCARD_SECTION
  586.                      goto FatalRegistry
  587.                   endif
  588.  
  589.                   ;       We are now in the parameters key for the adapter
  590.                   ;       to which we are comparing the current adapter
  591.  
  592.                   GetRegValue $(IE_KeyService), "BusNumber", BusInfo
  593.                   set CardBusNum = *($(BusInfo), 4)
  594.  
  595.                   GetRegValue $(IE_KeyService), "SlotNumber", SlotInfo
  596.                   set CardSlotNum = *($(SlotInfo), 4)
  597.  
  598.                   GetRegValue $(IE_KeyService), "DualPort", DualInfo
  599.                   Ifint $(RegLastError) == 0
  600.                           set CardDualPort = *($(DualInfo), 4)
  601.                   else
  602.                           set CardDualPort = "0"
  603.                   endif
  604.  
  605.                   ifint $(CardBusNum) == $(BusNum)
  606.                      ifint $(CardSlotNum) == $(SlotNum)
  607.                         ifint $(CardDualPort) == $(DualPort)
  608.                                 Set AlreadyInstalled = "YES"
  609.                         endif
  610.                      endif
  611.                   endif
  612.           endif
  613.         endif
  614.       EndForListDo
  615.  
  616.                 ifstr $(AlreadyInstalled) == "YES"
  617.                         goto NextAdapter
  618.                 endif
  619.  
  620.                 ;       -------------------------------------------------
  621.                 ;       The netcard has not yet been installed.  Add
  622.                 ;       it now.
  623.                 ;       -------------------------------------------------
  624.  
  625.         Shell $(UtilityInf), AddHardwareComponent, +
  626.             $(ProductHardwareName),+
  627.             $(STF_CONTEXTINFNAME),+
  628.             $(ProductKeyName)
  629.  
  630.         ifint $($R4) != -1
  631.             Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  632.         endif
  633.  
  634.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  635.             goto ShellCodeError
  636.         endif
  637.         set RegistryErrorIndex = $($R0)
  638.         Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  639.             EndWait
  640.             CloseRegKey $($R1)
  641.             CloseRegKey $($R2)
  642.             CloseRegKey $($R3)
  643.             goto FatalRegistry
  644.         endif
  645.  
  646.         Set HardNetCardKey      = $($R1)
  647.         Set HardNetRuleKey      = $($R2)
  648.         Set HardParameterKey    = $($R3)
  649.         Set AdapterNumber       = $($R4)
  650.  
  651.         ifint $(NETCARD_ID) == 36768
  652.             set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 32 Adapter"
  653.         else-ifint $(NETCARD_ID) == 36770
  654.             set MyTitle = "Slot "$(SlotNum)": IBM Auto LANStreamer MC 32 Adapter"
  655.         else-ifint $(NETCARD_ID) == 36772
  656.             set MyTitle = "Slot "$(SlotNum)": IBM LANStreamer MC 16 Adapter"
  657.         else-ifint $(NETCARD_ID) == 36776
  658.             set MyTitle = "Slot "$(SlotNum)": IBM EtherStreamer MC 32 Adapter"
  659.         else-ifint $(NETCARD_ID) == 36778
  660.                         ifint $(DualPort) == 0
  661.                                 Set MyTitle = "Slot "$(SlotNum)A": IBM Dual AutoLANStreamer MC 32 Adapter"
  662.                         else
  663.                                 Set MyTitle = "Slot "$(SlotNum)B": IBM Dual AutoLANStreamer MC 32 Adapter"
  664.                         endif
  665.         else-ifint $(NETCARD_ID) == 36779
  666.                         ifint $(DualPort) == 0
  667.                                 Set MyTitle = "Slot "$(SlotNum)A": IBM Dual EtherStreamer MC 32 Adapter"
  668.                         else
  669.                                 Set MyTitle = "Slot "$(SlotNum)B": IBM Dual EtherStreamer MC 32 Adapter"
  670.                         endif
  671.         else-ifint $(NETCARD_ID) == $(PCI_ADAPTER_ID)
  672.             set MyTitle = "["$(SlotNum)"] IBM LANStreamer PCI Adapter"
  673.         else
  674.             set MyTitle = "["$($R4)"] "$(ProductHardwareTitle)
  675.         endif
  676.  
  677.         Set MyService = "Streamer"$(AdapterNumber)
  678.  
  679.         Set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  680.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(MyTitle)},+
  681.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  682.                            {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  683.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  684.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  685.  
  686.         Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  687.  
  688.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  689.             goto ShellCodeError
  690.         endif
  691.  
  692.         CloseRegKey $(HardParameterKey)
  693.  
  694.         RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
  695.             $(MyService) $(SlotNum) $(NETCARD_ID) $(DualPort) $(BusNum)
  696.  
  697.         set CFG_ReturnCode = $(DLG_PB_CANCEL)
  698.         ifint $(ExitCode) == 0
  699.             set CFG_ReturnCode = $(DLG_PB_OK)
  700.         endif
  701.  
  702.         ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
  703.             set CommonStatus = STATUS_USERCANCEL
  704.             goto abandon
  705.         endif
  706.  
  707.         set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  708.         set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  709.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  710.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  711.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  712.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  713.  
  714.         Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  715.  
  716.         CloseRegKey $(HardNetCardKey)
  717.         CloseRegKey $(HardNetRuleKey)
  718.         CloseRegKey $(HardParameterKey)
  719.  
  720.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  721.             goto ShellCodeError
  722.         endif
  723.  
  724. NextAdapter = +
  725.  
  726.     EndForListDo           ; End of AdapterList
  727.  
  728. LastAdapter = +
  729.  
  730.     EndWait
  731.  
  732.     goto successful
  733.  
  734. ConfigureAdapter = +
  735.  
  736.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) NetCardKey
  737.     ifstr(i) $(NetCardKey) == ""
  738.         set CommonStatus = STATUS_USERCANCEL
  739.         goto successful
  740.     endif
  741.     GetRegValue $(NetCardKey) "ServiceName" ServiceInfo
  742.     set ServiceName = *($(ServiceInfo),4)
  743.     CloseRegKey $(NetCardKey)
  744.  
  745.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) ParamKey
  746.     ifstr(i) $(ParamKey) == ""
  747.         goto successful
  748.     endif
  749.  
  750.     set NETCARD_ID = "?"
  751.     GetRegValue $(ParamKey),"McaPosId", RegList
  752.     ifstr *($(RegList), 4) != ""
  753.         set NETCARD_ID = *($(RegList), 4)
  754.     endif
  755.  
  756.     set SlotNum = "?"
  757.     GetRegValue $(ParamKey),"SlotNumber", RegList
  758.     ifstr *($(RegList), 4) != ""
  759.         set SlotNum = *($(RegList), 4)
  760.     endif
  761.  
  762.     set SlotPort = "0"
  763.     GetRegValue $(ParamKey),"DualPort", RegList
  764.     ifstr *($(RegList), 4) != ""
  765.         set DualPort = *($(RegList), 4)
  766.     endif
  767.  
  768.     set BusNum = "?"
  769.     GetRegValue $(ParamKey),"BusNumber", RegList
  770.     ifstr *($(RegList), 4) != ""
  771.         set BusNum = *($(RegList), 4)
  772.     endif
  773.     CloseRegKey $(ParamKey)
  774.  
  775.     RunProgram ExitCode "" "" $(!STF_WINDOWSSYSPATH)"\stsetup.exe" +
  776.         $(ServiceName) $(SlotNum) $(NETCARD_ID) $(DualPort) $(BusNum)
  777.  
  778.     set CFG_ReturnCode = $(DLG_PB_CANCEL)
  779.     ifint $(ExitCode) == 0
  780.         set CFG_ReturnCode = $(DLG_PB_OK)
  781.     endif
  782.  
  783.     ifint $(CFG_ReturnCode) != $(DLG_PB_OK)
  784.         set CommonStatus = STATUS_USERCANCEL
  785.                 goto end
  786.     endif
  787.  
  788.     goto successful
  789.  
  790. BindingAdapter =+
  791.  
  792.     set Error = "Binding: Sorry, not yet implemented."
  793.     goto fatal
  794.  
  795. RemoveAdapter = +
  796.  
  797.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  798.  
  799.         Shell $(UtilityInf), RemoveSoftwareComponent, +
  800.             $(Manufacturer), +
  801.             $(ProductSoftwareName)
  802.  
  803.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  804.             goto ShellCodeError
  805.         endif
  806.  
  807.         set RegistryErrorIndex = $($R0)
  808.  
  809.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  810.             goto FatalRegistry
  811.         endif
  812.  
  813.     else
  814.  
  815.         Shell $(UtilityInf), RemoveHardwareComponent, +
  816.             $(Manufacturer), +
  817.             $(ProductSoftwareName), +
  818.             $(!NTN_RegBase)
  819.  
  820.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  821.             goto ShellCodeError
  822.         endif
  823.  
  824.         set RegistryErrorIndex = $($R0)
  825.  
  826.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  827.             goto FatalRegistry
  828.         endif
  829.  
  830.     endif
  831.  
  832.     goto end
  833.  
  834. UpgradeSoftware = +
  835.  
  836.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  837.  
  838.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  839.  
  840.         Ifstr $(KeyProduct) != $(KeyNull)
  841.  
  842.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  843.             set Version = *($(VersionInfo), 4)
  844.  
  845.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  846.  
  847.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  848.                 goto ShellCodeError
  849.             endif
  850.  
  851.             set !UG_Filename = $($R0)
  852.  
  853.             ifstr(i) $(!UG_Filename) != ""
  854.                 install "Install-Update"
  855.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  856.                     goto fatal
  857.                 endif
  858.             endif
  859.  
  860.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  861.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  862.  
  863.             ifint $(Version) != $(ProductVersion)
  864.             endif
  865.  
  866.             CloseRegKey $(KeyProduct)
  867.  
  868.         else
  869.  
  870.             goto FatalRegistry
  871.  
  872.         endif
  873.  
  874.     else
  875.  
  876.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  877.               $(MAXIMUM_ALLOWED) NetworkCardKey
  878.  
  879.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  880.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  881.             set ServiceName = *($(ServiceNameInfo), 4)
  882.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  883.                 $(MAXIMUM_ALLOWED) NetRuleKey
  884.  
  885.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  886.             else
  887.                 goto FatalRegistry
  888.             endif
  889.  
  890.             CloseRegKey $(NetRules)
  891.             CloseRegKey $(NetworkCardKey)
  892.         else
  893.             goto FatalRegistry
  894.         endif
  895.  
  896.         OpenRegKey $(!REG_H_LOCAL) "" +
  897.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  898.               $(MAXIMUM_ALLOWED) ServiceKey
  899.  
  900.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  901.             CloseRegKey $(ServiceKey)
  902.         else
  903.             goto FatalRegistry
  904.         endif
  905.     endif
  906.  
  907.     goto end
  908.  
  909. successful = +
  910.     goto end
  911.  
  912. abandon = +
  913.     ForListDo $(OEM_ABANDON_OPTIONS)
  914.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  915.             $(ProductSoftwareName), $($)
  916.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  917.             goto ShellCodeError
  918.         endif
  919.         set RegistryErrorIndex = $($R0)
  920.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  921.             goto FatalRegistry
  922.         endif
  923.     EndForListDo
  924.  
  925.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  926.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  927.             $(ProductSoftwareName), FALSE
  928.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  929.             goto ShellCodeError
  930.         endif
  931.         set RegistryErrorIndex = $($R0)
  932.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  933.             goto FatalRegistry
  934.         endif
  935.     endif
  936.     goto end
  937.  
  938. warning = +
  939.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  940.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  941.         goto ShellCodeError
  942.     endif
  943.     ifstr(i) $($R1) == "OK"
  944.         goto $(to)
  945.     else-ifstr(i) $($R1) == "CANCEL"
  946.         goto $(from)
  947.     else
  948.         goto "end"
  949.     endif
  950.  
  951. NonFatalInfo = +
  952.     Set CommonStatus = STATUS_USERCANCEL
  953.     Set Severity = STATUS
  954.     goto NonFatalMsg
  955.  
  956. nonfatal = +
  957.     Set Severity = NONFATAL
  958.     goto NonFatalMsg
  959.  
  960. NonFatalMsg = +
  961.     ifstr(i) $(Error) == ""
  962.         Set Severity = NONFATAL
  963.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  964.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  965.             goto ShellCodeError
  966.         endif
  967.         set Error = $($R0)
  968.     endif
  969.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  970.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  971.         goto ShellCodeError
  972.     endif
  973.     ifstr(i) $($R1) == "OK"
  974.         goto $(from)
  975.     else
  976.         goto "end"
  977.     endif
  978.  
  979. FatalRegistry = +
  980.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  981.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  982.         goto ShellCodeError
  983.     endif
  984.     set Error = $($R0)
  985.     goto fatal
  986.  
  987. fatal = +
  988.     ifstr(i) $(Error) == ""
  989.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  990.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  991.             goto ShellCodeError
  992.         endif
  993.         set Error = $($R0)
  994.     endif
  995.     Shell $(SubroutineInf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  996.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  997.         goto ShellCodeError
  998.     endif
  999.     goto setfailed
  1000.  
  1001. ShellCodeError = +
  1002.     set DlgType      = "MessageBox"
  1003.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1004.     set STF_MB_TEXT  = $(ShellCodeErrorText)
  1005.     set STF_MB_TYPE  = 1
  1006.     set STF_MB_ICON  = 3
  1007.     set STF_MB_DEF   = 1
  1008.     ui start "Error Message"
  1009.     goto setfailed
  1010.  
  1011. setfailed = +
  1012.     set CommonStatus = STATUS_FAILED
  1013.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1014.         set OEM_ABANDON_ON = FALSE
  1015.         goto abandon
  1016.     endif
  1017.     goto end
  1018.  
  1019. end = +
  1020.     goto term
  1021.  
  1022. term = +
  1023.  
  1024.     Return $(CommonStatus)
  1025.  
  1026. [GeneralConstants]
  1027.  
  1028.     from                =   ""
  1029.     to                  =   ""
  1030.     KeyNull             =   ""
  1031.     MAXIMUM_ALLOWED     =   33554432
  1032.     RegistryErrorIndex  =   NO_ERROR
  1033.     KeyProduct          =   ""
  1034.     TRUE                =   1
  1035.     FALSE               =   0
  1036.     NoTitle             =   0
  1037.     OldVersionExisted   =   $(FALSE)
  1038.  
  1039.  
  1040. [FileConstants]
  1041.  
  1042.     UtilityInf          =   "UTILITY.INF"
  1043.     SubroutineInf       =   "SUBROUTN.INF"
  1044.     SoftwareType        =   "driver"
  1045.     StreamerDLL         =   "callcfg.dll"
  1046.     NetEventDLL         =   "%SystemRoot%\System32\netevent.dll"
  1047.     DLG_PB_OK           =   1281        ;   User pressed "OK" pushbutton
  1048.     DLG_PB_CANCEL       =   1282        ;   User pressed "CANCEL" pushbutton
  1049.     PCI_ADAPTER_ID      =   24          ;   0x0018 in decimal
  1050.     Manufacturer        =   "Microsoft"
  1051.     ProductMajorVersion =   "3"
  1052.     ProductMinorVersion =   "1"
  1053.     ProductVersion      =   $(ProductMajorVersion)"."$(ProductMinorVersion)
  1054.     ProductSoftwareName     = "Streamer"
  1055.     ProductSoftwareImagePath = "%SystemRoot%\system32\drivers\streamer.sys"
  1056.     NetRuleSoftwareType     = "StreamerSys ndisDriver StreamerDriver"
  1057.     NetRuleSoftwareUse      = $(SoftwareType)
  1058.     NetRuleSoftwareBindForm = """StreamerSys"" yes no container"
  1059.     NetRuleSoftwareClass    = {"streamer basic"}
  1060.     NetRuleSoftwareBindable = {"streamerDriver streamerAdapter non exclusive 100"}
  1061.     ProductHardwareName     = "Streamer"
  1062.     NetRuleHardwareType     = "Streamer streamerAdapter"
  1063.     NetRuleHardwareBindForm = " yes yes container"
  1064.     NetRuleHardwareClass    = {"streamerAdapter basic"}
  1065.     ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  1066.     ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  1067.         NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  1068.  
  1069. [FileConstantsENG]
  1070.  
  1071.     FunctionTitle               = "IBM Streamer Family Adapter Card Setup"
  1072.     ProductSoftwareDescription  = "IBM Streamer Family Adapter Driver"
  1073.     ProductHardwareDescription  = "IBM Streamer Family Adapter "
  1074.     CANNOT_FIND_ANY_CARD        = "Network card is not present in the system"
  1075.     ProductSoftwareTitle        = "IBM Streamer Family Adapter Driver"
  1076.     ProductHardwareTitle        = "IBM Streamer Family Adapter "
  1077.     ShellCodeErrorTitle         = "Error: "$(FunctionTitle)
  1078.     ShellCodeErrorText          = "OEMSETUP.INF Shell Code Error."
  1079.  
  1080. [date]
  1081.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  1082.  
  1083. [Files-Dll]
  1084. 1, stsetup.exe, SIZE=29696
  1085. 1, callcfg.dll, SIZE=24576
  1086. 1, cfgedit.exe, SIZE=68608
  1087.  
  1088. [Files-Inf]
  1089. 1, oemsetup.inf, SIZE=40600, RENAME=$(!UG_Filename)
  1090.  
  1091. [Files-STREAMER]
  1092.  
  1093. 1, STREAMER.SYS, SIZE=112192
  1094.  
  1095. [Install-Option]
  1096.  
  1097.     set STF_VITAL = ""
  1098.  
  1099.     ifstr(i) $(AddCopy) == "YES"
  1100.  
  1101.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1102.  
  1103.     endif
  1104.  
  1105.     ifstr(i) $(DoCopy) == "YES"
  1106.  
  1107.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1108.        CopyFilesInCopyList
  1109.  
  1110.     endif
  1111.  
  1112.     Exit
  1113.  
  1114. [Install-Update]
  1115.    set STF_VITAL        = ""
  1116.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1117.  
  1118.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1119.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1120.  
  1121.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1122.    CopyFilesInCopyList
  1123.    exit
  1124.  
  1125. [Install-Dll]
  1126.    set STF_VITAL        = ""
  1127.    AddSectionFilesToCopyList Files-Dll $(!STF_SRCDIR) $(!STF_WINDOWSSYSPATH)
  1128.    CopyFilesInCopyList
  1129.    exit
  1130.  
  1131. ;*************************************************************************
  1132. ;
  1133. ;     SECTION:   GetPCIInformation
  1134. ;
  1135. ;     PURPOSE:   Get PCI vendor and device information
  1136. ;
  1137. ;   ARGUMENTS:   $0   Vendor ID
  1138. ;                $1   Device ID
  1139. ;
  1140. ;
  1141. ;    RETURNS:    $R0  List of bus and slot information
  1142. ;                       {{bus0,slot0},{bus1,slot1},{bus2,slot2}...{busk,slotk}}
  1143. ;
  1144. ;  REFERENCES:  Nothing
  1145. ;
  1146. ;    MODIFIES:  Nothing
  1147. ;
  1148. ;*************************************************************************
  1149.  
  1150. [GetPCIInformation]
  1151.     read-syms InitBaseVars
  1152.     set VendorID = $($0)
  1153.     set DeviceID = $($1)
  1154.     set MultiAdapter = "HARDWARE\Description\System\MultifunctionAdapter"
  1155.     set InfoList = {}
  1156.  
  1157.     OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter) $(MAXIMUM_ALLOWED) KeyMultiAdapter
  1158.  
  1159.     Ifstr $(KeyMultiAdapter) == $(KeyNull)
  1160.         goto GetPCIInformation_return
  1161.     endif
  1162.  
  1163.     EnumRegKey $(KeyMultiAdapter) BusList
  1164.  
  1165.     Debug-Output "Buslist"
  1166.     Debug-Output $(BusList)
  1167.  
  1168.     ForListDo $(BusList)
  1169.         set BusNum = *($($),1)
  1170.         OpenRegKey $(!REG_H_LOCAL) "" $(MultiAdapter)"\"$(BusNum) $(MAXIMUM_ALLOWED) KeyMultiAdapterBus
  1171.         GetRegValue $(KeyMultiAdapterBus) "Identifier" IdentifierInfo
  1172.         ifstr(i) *($(IdentifierInfo),4) == "PCI"
  1173.             ;
  1174.             ; Only check for PCI bus
  1175.             ;
  1176.             set device = 0
  1177. next_device = +
  1178.             ifint $(device) < 32
  1179.                 set function = 0
  1180. next_function = +
  1181.                 ifint $(function) < 8
  1182.                     LibraryProcedure Result, $(!LIBHANDLE), GetPciInformation, $(BusNum), $(device), $(function)
  1183.                     debug-output $(BusNum)".."$(device)".."$(function)".."$(Result)
  1184.                     ifint *($(Result),1) == 65535
  1185.                         Set-add device = $(device),1
  1186.                         goto next_device
  1187.                     endif
  1188.                     ifint *($(Result),1) == $(VendorID)
  1189.                         ifint *($(Result),2) == $(DeviceID)
  1190.                             set InfoList = >($(InfoList),{$(BusNum),$(device),$(function)})
  1191.                         endif
  1192.                     endif
  1193.                     set-add function = $(function), 1
  1194.                     goto next_function
  1195.                 endif
  1196.                 Set-add device = $(device),1
  1197.                 goto next_device
  1198.             endif
  1199. finish_bus = +
  1200.         endif
  1201.     EndForListDo
  1202.  
  1203.     CloseRegKey $(KeyMultiAdapter)
  1204.  
  1205. GetPCIInformation_return = +
  1206.     return $(InfoList)
  1207.  
  1208.  
  1209. ;
  1210. ;  Initialize general constants
  1211. ;
  1212. [InitBaseVars]
  1213.  
  1214. KeyNull            = ""
  1215. MAXIMUM_ALLOWED    = 33554432
  1216. KeyInfo            = {}
  1217. RegistryErrorIndex = NO_ERROR
  1218. NoTitle            = 0
  1219.  
  1220. CurrentControlSet  = "SYSTEM\CurrentControlSet"
  1221. ServicesBaseName   = $(CurrentControlSet)"\Services"
  1222. NetworkCardKeyName = $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards"
  1223.  
  1224. !RegLastError      = NO_ERROR
  1225.  
  1226.